/*
 * Copyright (C) 2014 Will Dignazio
 */
#include <stdio.h>
#include <Python.h>
#include <e-hal.h>
#include <pyepiphany.h>
#include "internal.h"

static EpiphanyMethod emethods[] =
{
	{"init", epiphany_init, METH_VARARGS, "Initialize Epiphany Library"},
	{"finalize", epiphany_finalize, METH_NOARGS, "Finalize Epiphany Library"},
	{"get_platform_info", epiphany_get_platform_info, METH_VARARGS, "Get platform information"},
	{"open", epiphany_open, METH_VARARGS, "Open/Define an eCore workgroup"},
	{NULL, NULL, 0, NULL},
};

/* Initialize the epiphany python module */
PyMODINIT_FUNC
initepiphany(void)
{
	PyObject *m;

	m = Py_InitModule("epiphany", emethods);
	if(m == NULL)
		return;

	initplatform(m);
	initworkgroup(m);
}

int
main(int argc, char *argv[])
{
	Py_SetProgramName(argv[0]);
	Py_Initialize();
	
	/* Initialize underlying static module(s) */
	initepiphany();

	return 0;
}
